<template>
    <div class="modal-content">
        <div class="modal-body">
            <div class="modal-confirm-body-wrapper">
                <div class="modal-confirm-body">
                    <span>登出提示</span>
                    <span>{{codeDistinguish == 'stop' ? '账号已停用' : '您的账号发生权限修改，请重新登录'}}</span>
                    <el-button type="primary" size="mini" @click="back">返回登出</el-button>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    import {
        mapState
    } from "vuex";
    export default {
        computed: {
            ...mapState(["codeDistinguish"]),
        },
        methods: {
            back() {
                localStorage.removeItem('token')
                this.$store.commit('setPermissionList', [])
                this.$store.commit('setFactoryInfo', {})
                this.$store.commit('setIsOutLogin', false)
                this.$store.commit('setCodeDistinguish', '')
                this.$router.replace('/login')
            }
        }
    }
</script>

<style lang="less" scoped>
    .modal-content {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 509px;
        height: 277px;
        background: url('~@/assets/login/expire.png') no-repeat;
        background-size: 100% 100%;
        z-index: 100000;

        .modal-body {
            width: 100%;
            height: 100%;
            padding: 32px 32px 24px;

            .modal-confirm-body-wrapper {
                padding: 50px 60px;
                height: 100%;
                width: 100%;
                display: flex;
                align-items: flex-start;
                flex-direction: column;
                justify-content: flex-end;

                .modal-confirm-body {
                    font-family: sans-serif;
                    color: rgba(0, 0, 0, .85);

                    span {
                        display: block;
                    }

                    span:nth-child(1) {
                        font-size: 14px;
                    }

                    span:nth-child(2) {
                        font-size: 12px;
                        font-family: sans-serif;
                        margin: 8px 0 0 38px;
                    }

                    .el-button {
                        margin-top: 24px;
                    }
                }
            }
        }
    }
</style>